﻿using AutoMapper;
using Rj_GsInsurance.Server.DataBaseContext.Entities;
using Rj_GsInsurance.Server.Models.InsurCatalogue;
using Rj_GsInsurance.Server.Models.InsurMsgDataInput;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rj_GsInsurance.Server.AutoMapper
{
    public class ServiceProfile : Profile
    {
        public ServiceProfile()
        {
            CreateMap<InsuranceHbgsDocUpload, DocUploadInput>();
            CreateMap<DocUploadInput, InsuranceHbgsDocUpload>();
            CreateMap<SystemTbWorker, DocUploadInput>()
                .ForMember(a=>a.Code,b=>b.MapFrom(src=>src.WorkerNo))
                .ForMember(a=>a.Yszyzh, b=>b.MapFrom(src=>src.JobCertificate))
                .ForMember(a=>a.Sfzh, b=>b.MapFrom(src=>src.IdentityCard))
                .ForMember(a=>a.Xyjgnbbm, b=>b.MapFrom(src=>src.WorkerNo))
                .ForMember(a=>a.Xb, b=>b.MapFrom(src=>src.Sex))
                .ForMember(a=>a.Name,b=>b.MapFrom(src=>src.Name));

            CreateMap<InsurWorkInjuryCatalogueDrug, Drug>();
            CreateMap<InsurWorkInjuryCatalogueTreatmentItem, TreatmentItem>();

            CreateMap<Drug, InsurWorkInjuryCatalogueDrug>();
            CreateMap<TreatmentItem, InsurWorkInjuryCatalogueTreatmentItem>();
        }
    }
}
